package com.hongya.article1.controller;

import com.hongya.article1.domain.UserEntity;
import com.hongya.article1.jpa.UserRespsitory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by hongyazhang on 2018/5/21.
 */
@RestController
@RequestMapping(value = "/user")
public class UserController {
    @Autowired
    private UserRespsitory userRespsitory;

    /**
     * 查询用户列表方法
     * @return
     */
    @RequestMapping(value ="/list" ,method = RequestMethod.GET)
    public List<UserEntity> list(){
        return userRespsitory.findAll();
    }
}
